/** 
 * File-Name:InternDao.java
 *
 * Created on 2012-3-11 下午2:43:45
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package cn.edu.pku.sei.i.dao;

import java.sql.Connection;
import java.sql.SQLException;

import neoutil.CommonDao;
import cn.edu.pku.sei.i.entity.Intern;

/**
 * Description:
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2012-3-11 下午2:43:45
 */
public class InternDao extends CommonDao<Intern, Long> {
	public InternDao(Connection connection) {
		super(Intern.class, connection);
	}

	public void save(Intern intern) throws SQLException {
		String sql = "INSERT INTO intern(uuid, "
				+ "name, email, password, mobilePhone, studentNO, "
				+ "enrollYear, bachelorGrade, fiveCoursesInterestedIn, description, rewards, "
				+ "experiences, whatToDoAfterGraduation, doctorOrNot, resumePath, internStatus, "
				+ "remarks) " + "VALUES(?, ?, ?, ?, ?, " + "?, ?, ?, ?, ?, "
				+ "?, ?, ?, ?, ?, " + "?, ?)";
		Object[] params = { intern.getUuid(), intern.getName(),
				intern.getEmail(), intern.getPassword(),
				intern.getMobilePhone(), intern.getStudentNO(),
				intern.getEnrollYear(), intern.getBachelorGrade(),
				intern.getFiveCoursesInterestedIn(), intern.getDescription(),
				intern.getRewards(), intern.getExperiences(),
				intern.getWhatToDoAfterGraduation(), intern.getDoctorOrNot(),
				intern.getResumePath(), intern.getInternStatus(),
				intern.getRemarks() };
		execute(sql, params);
	}
}
